<template>
  <NuxtLayout>
    <NuxtPage />
  </NuxtLayout>
</template>

<script setup lang="ts">
// 全局应用设置

// 暗黑模式初始化脚本
if (process.client) {
  const theme = localStorage.getItem('theme');
  const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;

  if (theme === 'dark' || (!theme && prefersDark)) {
    document.documentElement.classList.add('dark');
  } else {
    document.documentElement.classList.remove('dark');
  }
}
</script>

<style>
/* 全局样式 */
:root {
  color-scheme: light dark;
}

body {
  min-height: 100vh;
}

::selection {
  background-color: rgba(45, 212, 191, 0.3);
}
</style>